package com.pro.controller;

import com.pro.pojo.JsUnseal;
import com.pro.pojo.JsonData;
import com.pro.service.JsUnsealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsUnsealController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/11/25 18:27
 * @Author: ZPT
 */
@RestController
@RequestMapping("/unseal")
public class JsUnsealController {
    @Autowired
    private JsUnsealService unsealService;
    @RequestMapping("/addUnseal")
    public JsonData addUnseal(JsUnseal jsUnseal){
        Boolean aBoolean = unsealService.addUnseal(jsUnseal);
        return aBoolean!=false?JsonData.buildSuccess(aBoolean):JsonData.buildError("服务端错误");
    }

    @RequestMapping("/getUnseal")
    public JsonData getUnseal(Integer type,String account,String nickname,String unsealDate){
        List<JsUnseal> unsealList = unsealService.getUnseal(type,account,nickname,unsealDate);
        return unsealList!=null?JsonData.buildSuccess(unsealList):JsonData.buildError("服务端错误");
    }
    @RequestMapping("/deleteUnsealLog")
    public JsonData deleteUnsealLog(Integer id){
        Boolean aBoolean = unsealService.deleteUnsealLog(id);
        return aBoolean!=false?JsonData.buildSuccess(aBoolean):JsonData.buildError("服务端错误");
    }
}
